﻿using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AgileLogistics.View.Baoxiu
{
    /// <summary>
    /// Page_Baoxiu.xaml 的交互逻辑
    /// </summary>
    public partial class Page_Baoxiu : Page
    {
        Model.DBContext dBContext = new Model.DBContext();

        public Page_Baoxiu()
        {
            InitializeComponent();

            Messenger.Default.Register<Page>(this, "BaoxiuNavigatePage", NavigatePage);

            var CurrRole = dBContext.DB.Queryable<Model.Roles>().Where(r => r.Id == Comm.Temp.LoginUser.RoleId).First();
            if (!CurrRole.FuncCailiao)
            {
                menu_Daiban.Visibility = Visibility.Collapsed;
                mu_handle.Visibility = Visibility.Collapsed;
            }
        }

        public void NavigatePage(Page page)
        {
            Frm.Navigate(page);
        }
    }
}
